package example.Bricklet.LCD20x4;
import com.tinkerforge.BrickletLCD20x4;
import com.tinkerforge.IPConnection;

public class ExampleHelloWorld {
	private static final String host = "localhost";
	private static final int port = 4223;
	private static final String UID = "ABC"; // Change to your UID

	// Note: To make the examples code cleaner we do not handle exceptions.
	// Exceptions you
	// might normally want to catch are described in the documentation
	public static void main(final String args[]) throws Exception {
		final IPConnection ipcon = new IPConnection(); // Create IP connection
		final BrickletLCD20x4 lcd = new BrickletLCD20x4(ExampleHelloWorld.UID,
				ipcon); // Create device object

		ipcon.connect(ExampleHelloWorld.host, ExampleHelloWorld.port); // Connect
																		// to
																		// brickd
		// Don't use device before ipcon is connected

		// Turn backlight on
		lcd.backlightOn();

		// Write "Hello World"
		lcd.writeLine((short) 0, (short) 0, "Hello World");

		System.console().readLine("Press key to exit\n");
		ipcon.disconnect();
	}
}
